{% extends 'index.html' %}

{% block sidebar %}{% endblock %}

{% block content %}
    <form class="form-horizontal" role="form" method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">
                {{ form_obj.file_path.label }}
            </label>
            <div class="col-md-8 col-sm-8">
                {{ form_obj.file_path }}
                {% for error_data in form_obj.file_path.errors.get_json_data %}
                    <span style="color: red; margin-right: 5px">{{ error_data.message }};</span>
                {% endfor %}
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">
                {{ form_obj.file_type.label }}
            </label>
            <div class="col-md-8 col-sm-8">
                {{ form_obj.file_type }}
                {% for error_data in form_obj.file_type.errors.get_json_data %}
                    <span style="color: red; margin-right: 5px">{{ error_data.message }};</span>
                {% endfor %}
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">
                {{ form_obj.description.label }}
            </label>
            <div class="col-md-8 col-sm-8">
                {{ form_obj.description }}
                {% for error_data in form_obj.description.errors.get_json_data %}
                    <span style="color: red; margin-right: 5px">{{ error_data.message }};</span>
                {% endfor %}
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-1 control-label">
                {{ form_obj.config.label }}
            </label>
            <div class="col-md-10 col-sm-10">
                {{ form_obj.config }}
                {% for error_data in form_obj.config.errors.get_json_data %}
                    <span style="color: red; margin-right: 5px">{{ error_data.message }};</span>
                {% endfor %}
            </div>
        </div>
        {{ form_obj.submodul_id }}
        {{ form_obj.id }}

        <div class="row">
            <div class="col-md-3 col-sm-3 col-sm-offset-3 " style="color: red">{{ form_obj.non_field_errors.0 }}</div>
        </div>

        <a href="{% url 'configration_preview' project.id submodul.id %}" class="btn btn-info col-sm-offset-1">取消并返回</a>
        <button type="submit" class="btn btn-success col-sm-offset-7 " >保存</button>
    </form>
{% endblock %}

{% block custome_js %}
    <script src="/static/plugin/other/auto-line-number.js"></script>
    <script>
        $(function () {
            $("#textarea").setTextareaCount();
        });
    </script>
{% endblock %}